<template>
  <div class="user-info-container">
    <el-card>
      <div class="classify-info-box" id="userInfoBox">
        <!-- 标题 -->
        <h2 class="title">{{ $t('msg.classifyInfo.title') }}</h2>
        <!-- 头部 -->
        <div class="content">
          <el-descriptions :column="1" border>
            <el-descriptions-item :label="$t('msg.classifyInfo.name')">{{
              detailData.classifyName
            }}</el-descriptions-item>
            <el-descriptions-item :label="$t('msg.classifyInfo.registerDisc')">
              {{ $filters.discountFilterShow(detailData.registerDisc) }}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('msg.classifyInfo.diagnoseDisc')">
              {{ $filters.discountFilterShow(detailData.diagnoseDisc) }}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('msg.classifyInfo.recipeDisc')">
              {{ $filters.discountFilterShow(detailData.recipeDisc) }}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('msg.classifyInfo.treatDisc')">
              {{ $filters.discountFilterShow(detailData.treatDisc) }}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('msg.classifyInfo.goodsDisc')">
              {{ $filters.discountFilterShow(detailData.goodsDisc) }}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('msg.classifyInfo.otherDisc')">
              {{ $filters.discountFilterShow(detailData.otherDisc) }}
            </el-descriptions-item>
          </el-descriptions>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script setup>
import { defineProps, ref } from 'vue'
import { memberClassifyDetail } from '@/api/member'
import { watchSwitchLang } from '@/utils/i18n'
const props = defineProps({
  id: {
    type: String,
    required: true
  }
})
const detailData = ref({})
const getClassifyDetail = async () => {
  detailData.value = await memberClassifyDetail(props.id)
  console.log(detailData.value)
}
getClassifyDetail()
watchSwitchLang(getClassifyDetail)
// 打印相关
</script>

<style lang="scss" scoped>
.print-box {
  margin-bottom: 20px;
  text-align: right;
}
.classify-info-box {
  width: 640px;
  margin: 0 auto;
  .title {
    text-align: center;
    margin-bottom: 18px;
  }
  .content {
    display: flex;
    margin-bottom: 40px;
    ::v-deep .el-descriptions {
      flex-grow: 1;
    }
  }
}
</style>
